//
//  QDNewsTableviewController+Swift.swift
//  QDMetroClient
//
//  Created by YueWen on 2019/3/9.
//  Copyright © 2019 YueWen. All rights reserved.
//

import Foundation

extension QDNewsTableViewController {
    
    /// 请求资讯的header
    @objc func requestNewHeader(complete:@escaping (([String: Any]) -> ())){
        
        QDNetworkingManager.request(url: documentUrl, paramteres: ["moduleId":"20"], success: { (msg, data) in

            self.endHeaderRefreshing()
            self.endFooterRefreshing()
            complete(data)
            
        }) { (msg, errorType) in
            
            self.endHeaderRefreshing()
            self.endFooterRefreshing()
        }
        
    }
    
    
    /// 请求资讯列表
    @objc func requestNewList(page: Int = 0,complete:@escaping (([[String: Any]]) -> ())) {
        
        QDNetworkingManager.request(url: QDStaticHostUrl + "/document/getDocumentList", isArray: true, paramteres: ["page": page,"size": 10,"type":"20"], arraySuccess: { (msg, datas) in
            
            complete(datas)
            
        }) { (msg, errorType) in
            
            self.view.showTextHUD(text: msg)
        };
    }
}
